/*
 * @Author: ૮₍ ˙О˙₎ა
 * @Date: 2023-07-14 11:06:12
 */
import { http } from '@/utils/request'

export interface IReqLogin {
  token: string
}

export interface reqUserInfo {
  avatar: string
  buttons: string[]
  name: string
  roles: string[]
  routes: string[]
}

/**
 * @description: 请求登录信息
 * @return {*}
 * @param {string} username
 * @param {string} password
 */
export const reqLogin = (username: string, password: string) => {
  return http<IReqLogin>('/admin/acl/index/login', 'POST', {
    username,
    password
  })
}

/**
 * @description: 获取用户信息
 * @return {*}
 * @param {string}
 * @param {string}
 */
export const reqUserInfo = () => {
  return http<reqUserInfo>('/admin/acl/index/info', 'GET')
}

/**
 * @description: 退出登录
 * @return {*}
 * @param {string}
 * @param {string}
 */
export const reqLogout = () => {
  return http('/admin/acl/index/logout', 'POST')
}
